Skip to content

Class: LRUCache<TKey, TValue> ​

  • Namespace: Global
  • Assembly: Dew.Core.dll
csharp
public class LRUCache<TKey, TValue>

Properties ​

NameDeclarationDescription
Countpublic int Count { get; }

Methods ​

Clear() ​

csharp
public void Clear()

Set(TKey, TValue) ​

Adds or updates a key/value pair. If added, it becomes the most recently used. If the cache is at capacity, the least recently used item is removed.

csharp
public void Set(TKey key, TValue value)

Parameters:

NameTypeDescription
keyTKey
valueTValue

TryGet(TKey, out TValue) ​

Tries to get a value from the cache. If found, it's marked as most recently used.

csharp
public bool TryGet(TKey key, out TValue value)

Parameters:

NameTypeDescription
keyTKey
valueTValue

Returns: bool

Maintained by the Shape of Dreams Modding Community